package com.jeecg.demo.controller;

import com.jeecg.demo.entity.TraderStatistics;
import com.jeecg.demo.service.OrderdjServiceI;
import com.jeecg.demo.service.TradeorderServiceI;
import com.jeecg.demo.service.VEcpTradeorderServiceI;
import org.jeecgframework.core.common.controller.BaseController;
import org.jeecgframework.web.system.service.SystemService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @Title: Controller
 * @Description: 成交
 * @author onlineGenerator
 * @date 2018-11-20 08:34:36
 * @version V1.0
 *
 */
@Controller
@RequestMapping("/TraderStatmentController")
public class VecpTraderStatmentController extends BaseController {
    private static final Logger logger = LoggerFactory
            .getLogger(VecpTraderStatmentController.class);

    @Autowired
    private VEcpTradeorderServiceI vEcpTradeorderService;
    @Autowired
    private SystemService systemService;
    @Autowired
    private TradeorderServiceI tradeorderService;
    @Autowired
    private OrderdjServiceI orderdjService;

    /**
     * 成交列表 页面跳转
     *
     * @return
     */
    @RequestMapping(params = "list")
    public ModelAndView list(HttpServletRequest request, String type) {
        request.setAttribute("type", type);
        return new ModelAndView("com/jeecg/vEcpTradeorder/vEcpTradeorderList");
    }

    //成交报表
    @RequestMapping(params = "transcationstatment")
    public ModelAndView vEcpTradeorderController(HttpServletRequest request){
        String ztmc = request.getParameter("ztmc") == null ?"":request.getParameter("ztmc");
        String beginTime = request.getParameter("beginTime") == null ?"":request.getParameter("beginTime");
        String endTime = request.getParameter("endTime") == null ? "" : request.getParameter("endTime");
        List<TraderStatistics> traderStatisticsList = tradeorderService.getTraderStatisticsList(ztmc,beginTime,endTime);
        return new ModelAndView("com/jeecg/vEcpTradeorder/TraderStatmentList");
    }

}
